package io.renren.modules.task.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.task.model.TaskDetailBo;
import io.renren.modules.task.service.TaskDetailService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-11-21 17:25:31
 */
@RestController
@RequestMapping("generator/businesstaskdetail")
public class TaskDetailController {
    @Autowired
    private TaskDetailService taskDetailService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("generator:businesstaskdetail:list")
    public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = taskDetailService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("generator:businesstaskdetail:info")
    public R info(@PathVariable("id") Long id) {
        //BusinessTaskDetailEntity businessTaskDetail = businessTaskDetailService.getById(id);

        return R.ok().put("businessTaskDetail", "businessTaskDetail");
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("generator:businesstaskdetail:save")
    public R save(@RequestBody TaskDetailBo businessTaskDetail) {
        //businessTaskDetailService.save(businessTaskDetail);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("generator:businesstaskdetail:update")
    public R update(@RequestBody TaskDetailBo businessTaskDetail) {
        //businessTaskDetailService.updateById(businessTaskDetail);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("generator:businesstaskdetail:delete")
    public R delete(@RequestBody Long[] ids) {
        //businessTaskDetailService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
